from django.urls import path
from rest_framework.routers import DefaultRouter
from apps.headlines import views

urlpatterns = [
    # http://127.0.0.1:8000/channels/获取频道组
    path('channels/', views.ChannelsGroupView.as_view()),
    #/articles/search/ 搜索文章
    path('articles/search/',views.PublishSerchView.as_view()),
    #获取标签
    path('labels/',views.LabelsInfoView.as_view()),
    #上传图片
    # path('upload/avatar/',views.UploadAvatarView.as_view()),
    #文章详情
    path('article/<int:pk>/',views.ArticleInfoView.as_view()),
    #提交评论
    path('article/<int:pk>/publish_comment/',views.PublishCommentView.as_view()),
    #关注
    path('users/like/',views.UserLikeView.as_view())

]

router = DefaultRouter()
# GET http://127.0.0.1:8000/article/添加文章
# GET /article/2/channel/?page=1获取文章列表
router.register('article', views.AddArticleView, basename='images')
urlpatterns += router.urls
